Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: join selectivity #145

Merged
merged 30 commits into from
Mar 31, 2024
Merged

feat: join selectivity #145

merged 30 commits into from
Mar 31, 2024

Conversation

wangpatrick57
Copy link
Member

@wangpatrick57 wangpatrick57 commented Mar 31, 2024

Summary: Implemented join selectivity formulas for inner joins, left/right outer joins, and cross joins. Also properly accounts for filters in the join condition.

Demo:
We now match Postgres on our median Q-error. See #127 for more details on what queries this PR affected.
Screenshot 2024-03-31 at 13 13 48

Details:

  • We only consider equality checks on columns of different tables to be "join on conditions".
  • Join selectivity formulas are from Rogov 2022.
  • If there are multiple on conditions, we multiply their selectivities together.

@wangpatrick57 wangpatrick57 changed the title Phw2/join sel feat: join selectivity for inner, outer, and cross joins + join filters Mar 31, 2024
@wangpatrick57 wangpatrick57 marked this pull request as ready for review March 31, 2024 17:00
@wangpatrick57 wangpatrick57 changed the title feat: join selectivity for inner, outer, and cross joins + join filters feat: join selectivity Mar 31, 2024
@wangpatrick57 wangpatrick57 requested a review from Gun9niR March 31, 2024 17:13
Copy link
Contributor

@Gun9niR Gun9niR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

@wangpatrick57 wangpatrick57 merged commit 68666c4 into main Mar 31, 2024
1 check passed
@wangpatrick57 wangpatrick57 deleted the phw2/join-sel branch March 31, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants